<?php
class LoginForm extends sfForm
{
    
  public function configure()
  {
 
    $this->setWidgets(array(
      'email'        => new sfWidgetFormInputText(array(),array('size' => '25')),
      'password'  => new sfWidgetFormInputPassword(array('label' => 'Contraseña'),array('size' => '25')),
    ));
 
    $this->setValidators(array(
      'email'        => new sfValidatorEmail(array('required'=>true), array('required'=>'El email es obligatorio')),
      'password'  => new sfValidatorString(array('required'=>true), array('required'=>'Escribe tu contraseña')),
    ));
    
    $decorator = new myWidgetFormSchemaFormatterCustom($this->getWidgetSchema());
  	$this->widgetSchema->addFormFormatter('custom', $decorator);
  	$this->widgetSchema->setFormFormatterName('custom');
         

 
    $this->widgetSchema->setNameFormat('usuario[%s]');

        parent::configure(); 
        $this->disableLocalCSRFProtection(); 
        
        $this->getOption('email');
        $this->getOption('password');
  }
  
  public function getNameTo()
  {
      return 'LoginForm';
  }
 
}
